<template>
	<view class="boxes" :class="themeName">
		<view class="flex2 bg box md">
			<view class="title m-r-20">用户编号:</view>
			<view class="msg">{{msg.sn}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">用户昵称:</view>
			<view class="msg">{{msg.user.nickname}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">手机号码:</view>
			<view class="msg">{{msg.user.mobile}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">提现金额:</view>
			<view class="msg">￥{{msg.money}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">提现手续费:</view>
			<view class="msg">￥{{msg.handling_fee}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">到账金额:</view>
			<view class="msg color">￥{{msg.left_money}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">提现方式:</view>
			<view class="msg">
				<text v-if="msg.type==1">钱包余额</text>
				<text v-else-if="msg.type==2">微信零钱</text>
				<text v-else-if="msg.type==3">银行卡</text>
				<text v-else-if="msg.type==4">微信收款码</text>
				<text v-else-if="msg.type==5">支付宝收款码</text>
			</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">真实姓名:</view>
			<view class="msg">{{msg.real_name}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">提现时间:</view>
			<view class="msg">{{msg.time}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">审核时间:</view>
			<view class="msg">{{msg.transfer_time}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">审核备注:</view>
			<view class="msg">{{msg.audit_remark}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">转账说明:</view>
			<view class="msg">{{msg.transfer_remark}}</view>
		</view>
		<view class="flex2 bg box md">
			<view class="title m-r-20">提现状态:</view>
			<view class="msg color" v-if="msg.status == 1">待提现</view>
			<view class="msg color" v-else-if="msg.status == 2">提现中</view>
			<view class="msg color" v-else-if="msg.status == 3">提现成功</view>
			<view class="msg color" v-else-if="msg.status == 4">提现失败</view>
		</view>
		<view class="bg box bordernone md" v-if="msg.money_qr_code">
			<view>收款码</view>
			<image @click="previewImage(1)" class="addimg m-t-30" :src="msg.money_qr_code" mode=""></image>
		</view>
		<view class="bg box bordernone md" v-if="msg.transfer_voucher">
			<view>转账凭证</view>
			<image @click="previewImage(2)" class="addimg m-t-30" :src="msg.transfer_voucher" mode=""></image>
		</view>
		
	</view>
</template>

<script>
	import {
	    shoptixianinfo
	} from '@/api/others';
export default {
	data() {
		return {
			id:'',
			msg:{
				user:{}
			}
		};
	},
	async onLoad(options) {
		this.id = options.id;
		await this.getInfo();
	},
	methods: {
		getInfo(){
			shoptixianinfo({id:this.id}).then(res => {
				this.msg = res;
			});
		},
		// 预览
		previewImage: function(num) {
			let str = '';
			if(num==1){
				str = this.msg.money_qr_code
			}else if(num==2){
				str = this.msg.transfer_voucher
			}
			let imgs = []
			imgs.push(str)
			uni.previewImage({
				current: 0, //预览图片的下标
				urls: imgs //预览图片的地址，必须要数组形式，如果不是数组形式就转换成数组形式就可以
			})
		},
	}
};
</script>

<style lang="scss" scoped>
.boxes {
	background-color: #fff;
	height: 100%;
	.box {
		padding: 25rpx 35rpx;
		border-bottom: 1px solid #eee;
		.title{
			white-space:nowrap;
		}
		.msg{
			white-space: normal;
		}
		.color{
			color: #0980CC;
		}
	}
	.bordernone {
		border: none;
		.addimg {
			width: 220rpx;
			height: 220rpx;
		}
	}
}
</style>
